package com.origin.src.scan;

import com.origin.src.ApplicationTool;
import com.origin.src.scan.bean.ScanNoIndexBean;
import com.origin.src.scan.type.ScanAnnotation;
import com.origin.src.scan.type.ScanFather;
import com.origin.src.scan.type.ScanInterface;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

import static org.springframework.context.annotation.FilterType.ASSIGNABLE_TYPE;

@Configuration
//@ComponentScan(value = "com.origin.src.scan.bean   com.origin.src.scan.type")
@ComponentScan(value = "com.origin.src.scan.*",
        includeFilters = {@ComponentScan.Filter(value = ScanAnnotation.class),
                @ComponentScan.Filter(type = ASSIGNABLE_TYPE, value = {ScanInterface.class, ScanFather.class})}
)
//@ComponentScan(basePackageClasses = {ScanBean.class})
public class ScanConfiguration {

    public static void main(String[] args) {
        ScanNoIndexBean.class.getName();
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(ScanConfiguration.class);
        ApplicationTool.printBean(applicationContext);

    }



}
